package com.xinhe.web.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;

@Data
@ApiModel(description = "商品保存对象")
public class GoodsModel {
    @ApiModelProperty("id")
    private Long id;
    @ApiModelProperty("商品分类id")
    private Long goodsTypeId;
    @ApiModelProperty("商品专区分类id")
    private Long goodsZoneTypeId;
    @ApiModelProperty("商品名称")
    private String name;
    @ApiModelProperty("商品图标")
    private String iconPath;
    @ApiModelProperty("描述")
    private String dis;
    @ApiModelProperty("价格")
    private BigDecimal price;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("发货地址")
    private String sendAddress;

    @ApiModelProperty("运费")
    private BigDecimal freightFee = BigDecimal.ZERO;

    @ApiModelProperty("默认显示秒杀价格")
    private BigDecimal spikePrice = BigDecimal.ZERO;
    @ApiModelProperty("默认显示团购价格")
    private BigDecimal groupPurchasePrice = BigDecimal.ZERO;
    @ApiModelProperty("是否热销产品")
    private Integer isHotSales;
    @NotEmpty(message = "请上传商品相册")
    private Set<Long> attachIds;
    @Valid
    @NotEmpty(message = "商品规格不能为空,里面放的是删除之后需要修改和新增的")
    private List<GoodsPriceModel> goodsPriceList;
}
